//
//  YKTypeCloseKeyboardView.m
//  yuke
//
//  Created by Dejun Liu on 15/1/12.
//  Copyright (c) 2015年 juwan. All rights reserved.
//

#import "YKTapCloseKeyboardView.h"

@implementation YKTapCloseKeyboardView

- (void)awakeFromNib
{
    UITapGestureRecognizer *tp = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(closeKeyboard)];
    [self addGestureRecognizer:tp];
}

- (void)closeKeyboard
{
    [self.subviews enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
        UIView *view = obj;
        if (view.isFirstResponder) {
            [view resignFirstResponder];
        }
    }];
}

@end
